//
//  FeatureCollectionViewCell.m
//  MeterMart
//
//  Created by ENERGY on 2018/11/3.
//  Copyright © 2018年 ENERGY. All rights reserved.
//

#import "FeatureCollectionViewCell.h"

@interface FeatureCollectionViewCell()

@end
@implementation FeatureCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.contentView.backgroundColor = [UIColor whiteColor];
        __weak typeof (self)weakSelf = self;
        [self.contentView addSubview:self.bgView];
        [self.contentView addSubview:self.contentLab];
        [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.top.bottom.centerY.equalTo(weakSelf.contentView);
            make.height.mas_offset(25/WIDTH_6_SCALE);
        }];
        [self.contentLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(weakSelf.bgView);
            make.left.equalTo(weakSelf.bgView.mas_left).mas_offset(10/WIDTH_6_SCALE);
            make.right.equalTo(weakSelf.bgView.mas_right).mas_offset(-10/WIDTH_6_SCALE);
        }];
    }return self;
}
- (UILabel *)contentLab{
    if (!_contentLab) {
        _contentLab = [[UILabel alloc] init];
        _contentLab.font = DEF_FontSize_10;
        _contentLab.textColor = [UIColor blackColor];
//        _contentLab.layer.cornerRadius = 8;
//        _contentLab.layer.masksToBounds = YES;
//        _contentLab.layer.borderWidth = 1;
        _contentLab.textAlignment = NSTextAlignmentCenter;
    }return _contentLab;
}
- (UIView *)bgView{
    if (!_bgView) {
        _bgView = [[UIView alloc] init];
        _bgView.layer.cornerRadius = 8;
        _bgView.layer.masksToBounds = YES;
        _bgView.layer.borderWidth = 1;
    }return _bgView;
}
@end
